<template>
 	<view class="reply-container">
 		<view style="padding: 20rpx;">
 			<view class="title"><text style="color: red;">*</text>审核描述</view>
 			<textarea style="height: 320rpx;"  :maxlength="500" class="content" v-model="params.remark" placeholder="请输入巡逻描述..." name="" id="" cols="30" rows="10"></textarea>
 		</view>
 		<view class="title" style="margin-left: 20rpx;"><text style="color: red;">*</text>审核附件</view>
 		<view style="margin-left: 8rpx;">
 			<uploader :max="3" @input='onchange'></uploader>
 		</view>
 		<button class="patrol-btn" @click="submit">提交</button>
 	</view>
 </template>
 
 <script>
 	import uploader from '@/components/my-components/image-uploader.vue'
 	export default {
 		data() {
 			return {
				taskId: null,
 				params: {
 					
 				}
 			}
 		},
 		components: {
 			uploader
 		},
 		onLoad(options) {
			this.params = {...JSON.parse(options.obj), remark: '', accessory: ''}
 		},
 		methods: {
 			onchange(e) {
 				this.params.accessory = e.join(',')
 			},
 			submit() {
 				// console.log(this.params)
 				if(this.params.remark.trim() == ''){
 					uni.showToast({
 						title: '请填写审核描述',
 						icon: 'none'
 					})
 				}else {
 					this.completeApprove()
 				}
 			},
 			completeApprove() {
 				// this.params.id = parseInt(this.ticketId)
 				// this.params.操作类型 = 'complete'
 				uni.showLoading({mask: true})
 				this.$http.post('/flow/common/submit', this.params).then(res => {
 					// console.log(res)
 					if (res.code === 10000) {
 						uni.redirectTo({
 							url: '/ticketSystem/acceptSuccess/acceptSuccess?path=/pages/service/service' + '&title=返回服务页面'
 						})
 						
 					}
 				})
 			}
 		}
 	}
 </script>
 
 <style lang="scss">
 	.reply-container {
 		// padding: 20rpx;
 		.title {
 			margin-bottom: 20rpx;
 		}
 		.content {
 			width: 710rpx;
 			padding: 20rpx;
 			border: 2rpx solid #ccc;
 		}
 		.patrol-btn {
 			width: 568rpx;
 			height: 80rpx;
 			line-height: 80rpx;
 			margin-top: 200rpx;
 			background: linear-gradient(to right, #3350D9, #1152FC);
 			// background-color: #1152FC;
 			color: #fff;
 		}
 		.sign-item {
 			margin-left: 20rpx;
 			width: 220rpx;
 			height: 220rpx;
 			image {
 				width: 100%;
 				height: 100%;
 			}
 		}
 	}
 </style>